use UMAS0007b_OUTPUT.dta, clear


*** Marathon Questions ***
recode Q17_1-Q17_8 (2=0)

svyset [pw=weight]

*Concern about Terrorism*
svy: tab Q18
svy: tab Q18 if region==1 
svy: tab Q18 if region==2

*Increased Spectators*
svy: tab Q19
svy: tab Q19 if region==1 
svy: tab Q19 if region==2

*Punishment of Bombers*
svy: tab Q20a
svy: tab Q20a if region==1 
svy: tab Q20a if region==2

svy: tab Q20b
svy: tab Q20b if region==1 
svy: tab Q20b if region==2


*Security Measures*
svy: mean Q17_1-Q17_8








***New code for zip code of boston area***

*Generate and drop extra zipcode*

gen zipcode=real(lookupzip)

sort zipcode
merge zipcode using "zcta_cbsa_rel_10.dta"
drop if _m<3

*Generate Regions*
gen region=1 if cbsa==14460
replace region=2 if cbsa==12700 | cbsa==39300
replace region=3 if cbsa==49340
replace region=4 if cbsa==38340 | cbsa==44140
label define region 1 "Boston Area" 2 "New Bedford/Cape Cod" 3 "Central MA" 4 "Western MA"
label values region region

*Generate Boston area and Rest of MA*
gen region2=1 if region==1
replace region2=2 if region>1
label define region2 1 "Boston Area" 2 "Rest of MA"
label values region2 region2




